package com.hospital.schedule.module.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hospital.common.dto.schedule.module.AddDoctorAttendanceDto;
import com.hospital.common.pojo.TDoctorAttendance;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 医⽣考勤记录表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-09-15
 */
public interface TDoctorAttendanceMapper extends BaseMapper<TDoctorAttendance> {


    List<TDoctorAttendance> findDoctorAttendanceByNow(AddDoctorAttendanceDto addDoctorAttendanceDto);

    Integer addDoctorAttendance(TDoctorAttendance tDoctorAttendance);

    List<Long> inspectAttendance(@Param("doctorIdList") List<Long> doctorIdList
            ,@Param("formatToEndOfDay") String formatToEndOfDay
            ,@Param("formatToStartOfDay") String formatToStartOfDay);

    Integer addAbsence(Long doctorIds);

    List<Long> findIdDoctorAttendanceByDoctorId(@Param("doctorId") Long userId
            ,@Param("formatToStartOfDay") String formatToStartOfDay);

    Integer updateDoctorAttendance(TDoctorAttendance tDoctorAttendance);

    Long findIfDoctorAttendanceByNow(@Param("doctorId") Long doctorId
            ,@Param("formatToStartOfDay") String formatToStartOfDay
            ,@Param("formatToEndOfDay")String formatToEndOfDay);

    List<Long> selectOnUpdateBatchById(List<Long> doctorIds);

    Integer updateOnNotCheckOutTime();
}
